CC = gcc -Wall
mkindex:makeindex.o register_option.o  register_word.o display.o
	gcc -o mkindex makeindex.o register_option.o  register_word.o display.o
makeindex.o: makeindex.c common.h
register_option.o: register_option.c common.h
register_word.o: register_word.c  common.h
display.o: display.c common.h 

#test
test_mkindex: mkindex 
	@echo '----------------test mkindex-----------------'
	#./mkindex -i ./text1.txt -c configfile -o outputfile
	./mkindex -i ./testdata2/test3.txt -c configfile -o outputfile

test_register_option:
	@echo '----------------test register_option-----------------'
	gcc -DDEBUG -o register_option register_option.c
	./register_option -i ./text1.txt -o outputfile -c configfile
	

test_register_word: 
	@echo '----------------test register_word-----------------'
	gcc -DDEBUG -o register_word register_word.c
	./register_word

test_display: 
	@echo '----------------test display-----------------'
	gcc -DDEBUG -o display display.c
	./display
clean:
	rm *.o
